How to solve these challenges:
To be consistent with the filenames and paths run the commands on Ubuntu. Install it locally in a VM or at a cloud provider. Use my referral link below to create your account on DigitalOcean and youll get $100 in credit over 60 days: https://m.do.co/c/f1d4debf213f
Write your solution in a terminal or in a shell script and test it.
If your solution is not correct, then try to understand the error messages, watch the video again, rewrite the solution and test it again. Repeat this step until you get the correct solution.
Save the solution in a file for future reference or recap.
Challenge #1
Create a Bash script named script1.sh. Add the shebang.
Define a variable called country that holds the country you are living in.
Print the message: You live in YOUR_COUNTRY.
Run the script in different ways.
Are you stuck? Do you want to see the solution for this challenge? Click here and here.
Challenge #2
Create a script and define two string variables.
Add a commented line after the shebang and another inline comment.
Create a new variable by concatenating the two string variables.
Run the script.
Are you stuck? Do you want to see the solution for this challenge? Click here.
Challenge #3
Develop a Bash script that creates a new group and a new username. The group will be the users secondary group.
The username and the group will be given as input by the user that runs the script.
The script will also display the last 2 lines from the files where the users and the groups are saved in Linux.
Test the script by running it as root.
Are you stuck? Do you want to see the solution for this challenge? Click here.
Challenge #4
Create a script called fix_permissions.sh that prompts the user for a directory and changes the permissions of all subdirectories to 755 and to all files to 644 recursively.
Are you stuck? Do you want to see the solution for this challenge? Click here.